<template>
  <!-- 面包屑 -->
  <crumbs></crumbs>
  <!-- 标题 -->
  <h2  align="left" v-for="(item,index) in $route.matched" :key="index">{{ item.name }}</h2>
     <!-- 折叠框 -->
    <div class="demo-collapse">
      <el-collapse v-model="activeNames" @change="handleChange">
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="企业基础信息" name="1" >
          <div>
              <div class="content">
                <p>企业名称：{{name}}</p>
              </div>
              <div class="content">
                <p>组织机构代码：{{ organization_code }}</p>
                <p>社会信用证编号：{{ sc_number }}</p>
              </div>
              <div class="content">
                <p>成立时间：{{ founding_time }}</p>
                <p>注册资本：{{ capital }}</p>
              </div>
              <div class="content">
                <p>企业分级：{{ grade }}</p>
                <p>企业分类：{{ classify}}</p>
              </div>
              <div class="content">
                <p>单位规模：{{ scale}}</p>
                <p>运营状态：{{ status}}</p>
              </div>
              <div class="content">
                <p>法人代表：{{ representative}}</p>
                <p>法人固话：{{ tel }}</p>
              </div> 
              <div class="content">
                <p>法人手机：{{ phone}}</p>
                <p>法人邮箱：{{ email }}</p>
              </div>         
          </div>
        </el-collapse-item>
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="经营所在地信息" name="2">
          <div>
              <div class="content">
                <p>省（自治区、直辖市）{{province}}</p>
                <p>地（区、市、州、盟）：{{land}}</p>
              </div>
              <div class="content">
                <p>区（县、市、旗）：{{zone}}</p>
                <p>街（乡、镇）：{{street}}</p>
              </div>
              <div class="content">
                <p>详细地址：{{address}}</p>
                <p>邮政编码：{{postalcode}}</p>
              </div>
              <div class="content">
                <p>所属园区：{{park}}</p>
                <p>所属楼宇：{{build}}</p>
              </div>         
          </div>
        </el-collapse-item>
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="注册所在地信息" name="3">
          <div>
              <div class="content">
                <p>省（自治区、直辖市）:{{ province2}}</p>
                <p>地（区、市、州、盟）：{{ land2}}</p>
              </div>
              <div class="content">
                <p>区（县、市、旗）：{{zone2}}</p>
                <p>街（乡、镇）：{{ street2}}</p>
              </div>
              <div class="content">
                <p>详细地址：</p>{{ address2 }}
                <p>邮政编码：</p>{{ postalcode2 }}
              </div>
              <div class="content">
                <p>所属园区：{{ park2 }}</p>
                <p>所属楼宇：{{ build2}}</p>
              </div>         
          </div>
        </el-collapse-item>
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="联系方式信息" name="4">
          <div>
              <div class="content">
                <p>联系电话:{{tel2}}</p>
                <p>传真号码：{{ faxcode }}</p>
              </div>
              <div class="content">
                <p>联系人姓名：{{ name2 }}</p>
                <p>联系人职务：{{ job }}</p>
              </div>
              <div class="content">
                <p>联系人手机：{{ phone2}}</p>
                <p>联系人邮箱：{{ email2}}</p>
              </div>
              <div class="content">
                <p>公司网址：{{url}}</p>
              </div>
          
          </div>
        </el-collapse-item>
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="附件信息" name="5">
          <div>
          
          </div>
        </el-collapse-item>
        <el-button type="primary" :icon="Edit" style="float:left" circle class="edit" />
        <el-collapse-item title="行业信息" name="6">
          <div>
              <div class="content">
                <p>计划投资额：{{ plan_amount}}</p>
                <p>已完成投资额:{{ finish_amount }}</p>
              </div>
              <div class="content">
                <p>已完成投资额:{{ finish_amount }}</p>
                <p>规划建筑面积：{{ plan_build_area }}</p>
              </div>
              <div class="content">
                <p>规划机房面积：{{ plan_room_area }}</p>
                <p>已建面积：{{ build_area }}</p>
              </div>
              <div class="content">
                <p>在建面积：{{ be_area }}</p>
                <p>数据中心建设等级：{{ build_grade}}</p>
              </div>
              <div class="content">
                <p>规划模块化机房数量：{{ plan_area}}</p>
                <p>规划机柜数量：{{ plan_number}}</p>
              </div>
              <div class="content">
                <p>已建成机柜数量：{{ build_numer}}</p>
                <p>单机柜实际平均功率：{{ average_power }}</p>
              </div> 
              <div class="content">
                <p>规划机柜电力设计总功率：{{ total_power}}</p>
                <p>机房制冷方式：{{ refrigeration }}</p>
              </div> 
              <div class="content">
                <p>机房已认证等级：{{attestation_grade}}</p>
                <p>网络资源情况：{{ network_res }}</p>
              </div>         
          </div>
        </el-collapse-item>
      </el-collapse>
    </div>
    <div class="btn">
      <el-button @click="close" type="primary" style="width:100px;" >关闭</el-button>
    </div>
  </template>
  
  <script lang="ts">
  import { Edit } from '@element-plus/icons-vue'
  import { SetUp } from '@element-plus/icons-vue'
  import {defineComponent,ref,onBeforeMount} from 'vue'
  import crumbs from '../crumb/crumb.vue'
  import {useStore} from 'vuex'
  import {useRoute,useRouter} from 'vue-router'
  import axios from 'axios'
  export default defineComponent({
        name: "look",
        components:{
            crumbs
        },
        setup(){
         const store=useStore();
         const route=useRoute();
         const router=useRouter();
         const activeNames = ref(['1'])
         let id:any=route.query.id;
         //查看
         let  name:any=ref("")
         let  organization_code:any=ref("")
         let  sc_number:any=ref("")
         let  founding_time:any=ref("")
         let  capital:any=ref("")
         let  grade:any=ref("")
         let  classify:any=ref("")
         let  type:any=ref("")
         let  industry:any=ref("")
         let  scale:any=ref("")
         let  status:any=ref("")
         let  representative:any=ref("")
         let  tel:any=ref("")
         let  phone:any=ref("")
         let  email:any=ref("")
         let  update_time:any=ref("")
         let  province:any=ref("")
         let  land:any=ref("")
         let  zone:any=ref("")
         let  stree:any=ref("")
         let  address:any=ref("")
         let  postalcode:any=ref("")
         let  park:any=ref("")
         let  build:any=ref("")
         let  plan_amount:any=ref("")
         let  finish_amount:any=ref("")
         let  be_area:any=ref("")
         let  total_area:any=ref("")
         let  plan_build_area:any=ref("")
         let  plan_room_area:any=ref("")
         let  build_area:any=ref("")
         let  build_grade:any=ref("")
         let  plan_area:any=ref("")
         let  average_power:any=ref("")
         let  plan_number:any=ref("")
         let  refrigeration:any=ref("")
         let  attestation_grade:any=ref("")
         let  build_numer:any=ref("")
         let  total_power:any=ref("")
         let  tel2:any=ref("")
         let  faxcode:any=ref("")
         let  name2:any=ref("")
         let  job:any=ref("")
         let  phone2:any=ref("")
         let  email2:any=ref("")
         let  url:any=ref("")
         let  province2:any=ref("")
         let  land2:any=ref("")
         let  zone2:any=ref("")
         let  street2:any=ref("")
         let  address2:any=ref("")
         let  postalcode2:any=ref("")
         let  park2:any=ref("")
         let  build2:any=ref("")
         let  street:any=ref("")
         let  network_res:any=ref("")
        let enterprise_id:any=JSON.parse(id).enterprise_id
         const handleChange = (val: string[]) => {
            console.log(val)
          }
         const close = () => {
          router.push('/basic')
            }
    onBeforeMount(()=>{
      console.log(route.query.id)
                axios({
                  url:"http://1.14.73.59:8080/enterprise/seeEnterpriserInformation",
                  method:"post", 
                  params:{
                    id:route.query.id,
                    enterprise_id:route.query.id
                  }          
        }).then(resp=>{
          console.log("11111111",resp.data.data.name)
          name.value=resp.data.data.name
          organization_code.value=resp.data.data.organization_code
          sc_number.value=resp.data.data.sc_number
          founding_time.value=resp.data.data.founding_time
          capital.value=resp.data.data.capital
          grade.value=resp.data.data.grade
          classify.value=resp.data.data.classify
          type.value=resp.data.data.type
          industry.value=resp.data.data.industry
          scale.value=resp.data.data.scale
          status.value=resp.data.data.status
          representative.value=resp.data.data.representative
          update_time.value=resp.data.data.update_time
          email.value=resp.data.data.email
          province.value=resp.data.data.province
          land.value=resp.data.data.land
          zone.value=resp.data.data.zone
          street.value=resp.data.data.street
          address.value=resp.data.data.address
          postalcode.value=resp.data.data.postalcode
          park.value=resp.data.data.park
          plan_amount.value=resp.data.data.plan_amount
          finish_amount.value=resp.data.data.finish_amount
          be_area.value=resp.data.data.be_area
          total_area.value=resp.data.data.total_area
          plan_build_area.value=resp.data.data.plan_build_area
          plan_room_area.value=resp.data.data.plan_room_area
          build_area.value=resp.data.data.build_area
          build_grade.value=resp.data.data.build_grade
          plan_area.value=resp.data.data.plan_area
          plan_number.value=resp.data.data.plan_number
          refrigeration.value=resp.data.data.refrigeration
          attestation_grade.value=resp.data.data.attestation_grade
          build_numer.value=resp.data.data.build_numer
          total_power.value=resp.data.data.total_power
          network_res.value=resp.data.data.network_res
          faxcode.value=resp.data.data.faxcode
          name2.value=resp.data.data.name2
          job.value=resp.data.data.job
          phone2.value=resp.data.data.phone2
          email2.value=resp.data.data.email2
          url.value=resp.data.data.url
          province2.value=resp.data.data.province2
          land2.value=resp.data.data.land2
          zone2.value=resp.data.data.zone2
          street2.value=resp.data.data.street2
          address2.value=resp.data.data.address2
          postalcode2.value=resp.data.data.postalcode2
          park2.value=resp.data.data.park2
          build2.value=resp.data.data.build2

        })
            })
    return{
          close,
          router,
          ref,
          SetUp,
          store,
          route,
          activeNames,
          handleChange,
          Edit,
          crumbs,
          enterprise_id,
          //查看
          name,
          organization_code,//组织机构代码
          sc_number,//社会信用证编号
          founding_time,//成立时间
          capital,//注册资本（万元）
          grade,//企业分级
          classify,//企业分类
          type,//控股类型
          industry,//所属行业
          scale,//单位规模
          status,//运营状态
          representative,//法人代表
          tel,//法人固话
          phone,//法人手机
          email,//法人邮箱
          update_time,
          province,//省
          land,//地
          zone,//区
          street,//街
          address,//详细地址
          postalcode,//邮政编码
          park,//所属园区
          build,//所属楼宇
          plan_amount,//计划投资额
          finish_amount,//已完成投资额
          be_area,//在建面积
          total_area,//总规划面积
          plan_build_area,//规划建筑面积
          plan_room_area,//规划机房面积
          build_area,//已建面积
          build_grade,//数据中心建设等级
          plan_area,//规划模块化机房数量
          average_power,//单机柜实际平均功率
          plan_number,//规划机柜数量
          refrigeration,//机房制冷方式
          attestation_grade,//机房已认证等级
          build_numer,//已建成机柜数量
          total_power,//规划机柜电力设计总功率
          network_res,//网络资源情况
          tel2,//联系电话
          faxcode,//传真号码
          name2,//联系人姓名
          job,//职务
          phone2,//手机
          email2,//邮箱
          url,//网址
          province2,
          land2,
          zone2,
          street2,
          address2,
          postalcode2,
          park2,
          build2
         }
        }
    })
  </script>
  <style scoped>
  .demo-collapse{
    margin-left:20px;
    margin-right:20px;
  }
  .btn{
    margin-top:40px;
    margin-right:20px;
    float:right;
    width:100px;
  }
  .edit{
    margin-top:10px;
    margin-right:10px;
  }
  .content{
    display:flex; 
    justify-content:space-around;
  }
 </style>
  